﻿using Mes.Application.DTO.Inputs.Operations;

namespace Mes.Application.DTO.Results.Operations
{
    public class OperResult : OperCommon
    {
        public bool First_Oper { get; set; } = false;

        public bool Final_Oper { get; set; } = false;

        public int Display_Seq { get; set; } = 0;

        public List<OperEntLinkResult> OperEntLinks { get; set; }

        public List<OperAttrResult>? OperAttrs { get; set; }

        public List<OperStepGrpResult>? OperStepGrps { get; set; }

        public List<BomItemOperLinkResult>? BomItemsOper { get; set; }
    }

    public class OperEntLinkResult : OperEntLinkInput
    {
        public string ProductionUnitCode { get; set; } = string.Empty;

        public string ProductionUnitName { get; set; } = string.Empty;
    }

    public class OperAttrResult : OperAttrInput
    {
        public int Data_Type { get; set; } = 0;

        public string Attr_Desc { get; set; } = string.Empty;
    }

    public class OperStepGrpResult : OperStepGrpCommon
    {
        public List<OperStepResult> OperSteps { get; set; }
    }

    public class OperStepResult : OperStepCommon
    {
        public List<BomItemOperLinkResult>? BomItemsOperStep { get; set; } = null;
    }

    public class BomItemResult : BomItem
    {
        public string MaterialCode { get; set; } = string.Empty;

        public string MaterialName { get; set; } = string.Empty;

        public double Quantity { get; set; } = 1000;

        public double RemainQuantiry { get; set; } = 1000;
    }

    public class BomItemOperLinkResult
    {
        public int Bom_Id { get; set; } = 0;

        public string BomCode { get; set; } =string.Empty;

        public string BomName { get; set; } = string.Empty;

        public List<BomItemResult> BomItems { get; set; }
    }

    /// <summary>
    /// 分页查询工序出参
    /// </summary>
    public class OpersResult
    {
        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作名称
        /// </summary>
        public string? Oper_Desc { get; set; } = null;

        /// <summary>
        /// 类型
        /// </summary>
        public string? Oper_Type { get; set; } = null;

        /// <summary>
        /// 操作成本
        /// </summary>
        public double? Oper_Cost { get; set; } = null;

        /// <summary>
        /// 描述
        /// </summary>
        public string? Notes { get; set; } = null;
    }
}
